package com.yuyou.activity.comm.api.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.activity.comm.service.service.ICaptchaService;
import com.yuyou.activity.comm.service.vo.resp.RespCaptcha;
import com.yuyou.activity.util.bean.ReturnResult;

@Api(value="CaptchaController",description="验证码接口")
@Validated
@RestController
@RequestMapping(value="/api/captcha")
public class CaptchaController {


	@Autowired
	private ICaptchaService captchaService;

	@ApiOperation(value="生成验证码,在img前加上data:image/jpeg;base64,")
    @RequestMapping(value ="/generCaptcha",method = {RequestMethod.GET, RequestMethod.POST})
    public ReturnResult<RespCaptcha> generCaptcha() throws Exception{
    	RespCaptcha res=captchaService.generCaptcha();
        return ReturnResult.success(res); 
    }


	
}
